//
// Created by cxh on 2021/10/21.
//

#ifndef MRENDER_OBJECT_H
#define MRENDER_OBJECT_H

#include <vector>
#include "String.h"
#include "Log.h"
#include "imgui/imgui.h"
#include "imgui/imgui_impl_glfw.h"
#include "imgui/imgui_impl_opengl3.h"

//安全释放内存
#define SAFE_DELETE(p)       { if(p) { delete (p);     (p)=NULL; } }
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p);   (p)=NULL; } }
#define SAFE_RELEASE(p)      { if(p) { (p)->Release(); (p)=NULL; } }
//获得文件名
#define GET_CLASS(fp) String::getClassName(fp)
//获得数组长度
#define GET_ARRAY_LEN(array) sizeof(array) / sizeof(array[0])
#define CP_VECTOR_TO_ARRAY(array, vector) {if(array) memcpy(array, &vector[0], sizeof(vector[0]) * vector.size());}

/**
 * 物体基类
 */
class Object {
protected:
    virtual Object clone();
public:
    Object();
    ~Object();
    virtual String toString();
};


#endif //MRENDER_OBJECT_H
